package com.hksj.wmp.vo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

@Data
@ApiModel("权限信息")
public class MenuVO {

    @ApiModelProperty(value = "菜单id")
    private String id;

    @ApiModelProperty(value = "父级菜单id")
    private String parentId;

    @ApiModelProperty(value = "菜单名")
    private String name;

    @ApiModelProperty(value = "路由地址")
    private String path;

    @ApiModelProperty(value = "权限标识")
    private String code;

    @ApiModelProperty(value = "菜单图标")
    private String icon;

    @ApiModelProperty(value = "排序号")
    private Integer sortIndex;

    @ApiModelProperty(value = "菜单状态（1正常 0停用）")
    private Integer status;

    @ApiModelProperty(value = "备注")
    private String describe;

    @ApiModelProperty(value = "URL,路由")
    private String url;

    @ApiModelProperty(value = "元数据")
    private Meta meta;

    @ApiModelProperty(value = "子级菜单列表")
    private List<MenuVO> childList;

    @Data
    public class Meta{
        private String title;

        private Boolean isHide = false;

        private List<String> roles;

        private String icon;

    }

    @JsonIgnore
    public Meta getMetaInstance(){
        return new Meta();
    }

}
